import request from '@/utils/request'

// 轮播图
export function getBannerList() {
	return request({
		url: '/shops/carousels',
		method: 'get',
	})
}

// 房源列表
export function GetHouseListByPage(data) {
	return request({
		url: '/v1/mini/house/page',
		method: 'post',
		data
	})
}

// 房源详情
export function GetHouseDetail(data) {
	return request({
		url: '/v1/mini/house/detail',
		method: 'get',
		params: data
	})
}


// 根据房源id查询sku
export function GetHouseSkuInfo(data) {
	return request({
		url: '/v1/mini/house/skuInfo',
		method: 'get',
		params: data
	})
}



// 获取全局配置
export function GetAppConfig() {
	return request({
		url: '/v1/mini/config/detail',
		method: 'get',
	})
}


// 发布房源
export function releaseRoom(data) {
	return request({
		url: '/v1/mini/house',
		method: 'post',
		data
	})
}

// 修改房源
export function UpDateRoom(data) {
	return request({
		url: '/v1/mini/house',
		method: 'put',
		data
	})
}

// 置顶付费
export function PayTopRelease(data) {
	return request({
		url: '/v1/mini/house/payTopRelease',
		method: 'post',
		data
	})
}

// 置顶付费
export function DelMyHouse(data) {
	return request({
		url: '/v1/mini/house',
		method: 'DELETE',
		data
	})
}

// 房源收藏
export function HouseCollect(data) {
	return request({
		url: '/v1/mini/house_collect',
		method: 'POST',
		data
	})
}

// 创建订单
export function CreateOrder(data) {
	return request({
		url: '/v1/mini/pay/wxH5HousePay',
		method: 'POST',
		data
	})
}

// 订单详情
export function OrderDetail(data) {
	return request({
		url: '/v1/mini/order/detail',
		method: 'GET',
		params: data
	})
}

// 订单列表
export function GetOrderList(data) {
	return request({
		url: '/v1/mini/order',
		method: 'GET',
		params: data
	})
}

// 提现订单列表
export function GetWithdrawalOrderList(data) {
	return request({
		url: '/v1/mini/order/withdrawalOrder',
		method: 'GET',
		params: data
	})
}


// 订单退款
export function HouseRefund(data) {
	return request({
		url: '/v1/mini/pay/wxH5HouseRequestRefund',
		method: 'post',
		data
	})
}

// 计算本月收益
export function CalcFlow(data) {
	return request({
		url: '/v1/mini/flow/calcFlow',
		method: 'GET',
		params: data
	})
}

// 订单提现
export function Withdrawal(data) {
	return request({
		url: '/v1/mini/withdrawal/action',
		method: 'post',
		data
	})
}

// 修改用户基本信息
export function ChangeUserInfo(data) {
	return request({
		url: '/v1/mini/user/userBaseInfo',
		method: 'PUT',
		data
	})
}


//文件上传
export function Upload(data) {
	return request({
		url: '/v1/alioss/upload',
		method: 'post',
		data,
		headers: {
			'Content-Type': 'multipart/form-data'
		},
	})
}

// 广告轮播查询
export function GetAdvertisement(data) {
	return request({
		url: '/v1/house/ad/byType',
		method: 'GET',
		params: data
	})
}

// 确认入住
export function OrderCheckIn(data) {
	return request({
		url: '/v1/mini/order/checkIn',
		method: 'post',
		data
	})
}

// 获取银行卡字典
export function GetBankList(data) {
	return request({
		url: '/v1/dict/code',
		method: 'GET',
		params: data
	})
}

// 用户添加或修改银行卡预留信息
export function AddOrUpdateBankInfo(data) {
	return request({
		url: '/v1/mini/user/addOrUpdateBankInfo',
		method: 'POST',
		data
	})
}

// 付款到银行卡
export function PayToBankCard(data) {
	return request({
		url: '/v1/mini/pay/payToBankCard',
		method: 'POST',
		data
	})
}

// 分页查询提现记录
export function WithdrawalList(data) {
	return request({
		url: '/v1/mini/withdrawal/page',
		method: 'get',
		params: data
	})
}